<?php
//header('Content-Type: text/html; charset=utf-8');
require_once("../sqlConn.php");



$action=$_GET['action'];
switch($action)
{
	case 'getShopList':
	   getShopList($_POST['areaid']);
	   break;

}
function getShopList($areaid)
{
	connectDB();
	//echo "$areaid";
	if($areaid)
	{
		$sql="select * from shop where areaid='$areaid' ";
		$res=mysql_query($sql);	
		$List="[";				
		$i=0;	
		if(!$res)
		{
			echo "$res";
			return false;
		}
		while($row=mysql_fetch_array($res))
		{
			//echo " i : $i";
			$info=str_replace("\r\n","<br>",$row['info']);
			$info=str_replace("\n","<br>",$info);
	
			$rowStr="{id:'".$row["id"]."',areaid:'".$row["areaid"]."',name:'".$row["name"].
				"',score:'".$row["score"]."',scoretime:'".$row["scoretime"]."',info:'".$info."'},";
			$List.=$rowStr;		
			$i++;
		}
		if($i>0)
		{
			 $helpList=substr_replace($helpList,'',-1,1);
		}
		$List.="]";
		echo $List;
	}
}

?>